﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogicComponents
{
    public  class GateNot
    {
        private Wire _input, _exit;

        public void setInputWire (Wire input)
        {
            _input = input;
            _input.ValueChanged += operate;
            operate();
        }

        private void operate ()
        {
            _exit.setValue(!_input.getValue() );
        }

        public GateNot()
        {
            _exit = new Wire();
            _input = new Wire();
            _input.ValueChanged += operate ;
            
        }

        public GateNot(Wire input)
        {
            _exit = new Wire();

            setInputWire(input);
        }

        public Wire getExit ()
        {
            return _exit;
        }

        public void  setInputValue(bool value)
        {
            _input.setValue(value);
        }

    }
}
